package com.weitu.permission.role.entity;

import java.io.Serializable;

/**
 * Table: SYS_ROLE_AUTHORITY
 */
public class RoleAuthority implements Serializable {
    /**
     * Column: SYS_ROLE_AUTHORITY.roleId
     */
    private String roleId;

    /**
     * Column: SYS_ROLE_AUTHORITY.authorityId
     */
    private String authorityId;


    private String authorityName;

    /**
     * Table: SYS_ROLE_AUTHORITY
     */
    private static final long serialVersionUID = 1L;

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId == null ? null : roleId.trim();
    }

    public String getAuthorityId() {
        return authorityId;
    }

    public void setAuthorityId(String authorityId) {
        this.authorityId = authorityId == null ? null : authorityId.trim();
    }

    public String getAuthorityName() {
        return authorityName;
    }

    public void setAuthorityName(String authorityName) {
        this.authorityName = authorityName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        RoleAuthority that = (RoleAuthority) o;

        if (roleId != null ? !roleId.equals(that.roleId) : that.roleId != null) return false;
        if (authorityId != null ? !authorityId.equals(that.authorityId) : that.authorityId != null) return false;
        return authorityName != null ? authorityName.equals(that.authorityName) : that.authorityName == null;
    }

    @Override
    public int hashCode() {
        int result = roleId != null ? roleId.hashCode() : 0;
        result = 31 * result + (authorityId != null ? authorityId.hashCode() : 0);
        result = 31 * result + (authorityName != null ? authorityName.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("RoleAuthority{");
        sb.append("roleId='").append(roleId).append('\'');
        sb.append(", authorityId='").append(authorityId).append('\'');
        sb.append(", authorityName='").append(authorityName).append('\'');
        sb.append('}');
        return sb.toString();
    }
}